<!DOCTYPE html>
<html>
  <head>
  <meta charset='UTF-8'>
  <title>Atom API Documentation</title>
  <link rel='stylesheet' href='../assets/biscotto.css' type='text/css'>
  <script src='../assets/biscotto.js'></script>
  <script src='../assets/search_data.js'></script>
</head>
  <body>
    <div id='base' data-path='..&#47;'></div>
<div id='header'>
  <div id='menu'>
    <a href='../docs/README.md.html' title='Atom'>Atom</a>
    &raquo;
    <a href='../class_index.html' title='Index'>Index</a>
    &raquo;
    <span class='title'>Workspace</span>
    <nav>
      <ul>
        <li class='noframes'>
          (<a class='noframes' href='Workspace.html#'>no frames</a>)
        </li>
      </ul>
    </nav>
    <div id='search'>
      <a id='class_list_link' href='../class_list.html'>Classes</a>
      <a id='file_list_link' href='../file_list.html'>Files</a>
      <a id='method_list_link' href='../method_list.html'>Methods</a>
      <a id='extra_list_link' href='../extra_list.html'>Extras</a>
    </div>
  </div>
  <iframe id='search_frame'></iframe>
  <div id='fuzzySearch'>
    <input type='text'>
    <ol></ol>
  </div>
  <div id='help'>
    <p>
      Quickly fuzzy find classes, mixins, methods, file:
    </p>
    <ul>
      <li>
        <span>Ctrl-T</span>
        Open fuzzy finder dialog
      </li>
    </ul>
    <p>
      In frame mode you can toggle the list naviation frame on the left side:
    </p>
    <ul>
      <li>
        <span>Ctrl-L</span>
        Toggle list view
      </li>
    </ul>
    <p>
      You can focus a list in frame mode or toggle a tab in frameless mode:
    </p>
    <ul>
      <li>
        <span>Ctrl-C</span>
        Class list
      </li>
      <li>
        <span>Ctrl-I</span>
        Mixin list
      </li>
      <li>
        <span>Ctrl-F</span>
        File list
      </li>
      <li>
        <span>Ctrl-M</span>
        Method list
      </li>
      <li>
        <span>Ctrl-E</span>
        Extras list
      </li>
    </ul>
    <p>
      You can focus and blur the search input:
    </p>
    <ul>
      <li>
        <span>Ctrl-S</span>
        Focus search input
      </li>
      <li>
        <span>Esc</span>
        Blur search input
      </li>
    </ul>
    <p>
      In frameless mode you can close the list tab:
    </p>
    <ul>
      <li>
        <span>Esc</span>
        Close list tab
      </li>
    </ul>
  </div>
</div>
    <div id='content'>
      <h1>
        Class
        Workspace
      </h1>
      <div class='stability-1'>
        <span class='heading'></span>
        <div class='message'></div>
      </div>
      <table class='box'>
        <tr>
          <td>Defined in:</td>
          <td>src&#47;workspace.coffee</td>
        </tr>
        <tr>
          <td>Inherits:</td>
          <td>
            <a href='https://atom.io/docs/api/v0.69.0/api/classes/Model.html'>Model</a>
          </td>
        </tr>
      </table>
      <h2>Overview</h2>
      <div class='docstring'>
  <p>Represents the state of the user interface for the entire window. An instance of this class is available via the <code>atom.workspace</code> global.</p><p>Interact with this object to open files, be notified of current and future
editors, and manipulate panes. To add panels, you&#39;ll need to use the
<a href='WorkspaceView.html'>WorkspaceView</a> class for now until we establish APIs at the model layer. </p>
</div>
<div class='tags'>
</div>
      <h2>Instance Method Summary</h2>
      <ul class='summary'>
  <li>
    <span class='signature'>
      <a href='Workspace.html#activateNextPane-instance'>
        ::<strong>activateNextPane</strong>()
      </a>
    </span>
    <span class='desc'>
      Make the next pane active.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#activatePreviousPane-instance'>
        ::<strong>activatePreviousPane</strong>()
      </a>
    </span>
    <span class='desc'>
      Make the previous pane active.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#decreaseFontSize-instance'>
        ::<strong>decreaseFontSize</strong>()
      </a>
    </span>
    <span class='desc'>
      Decrease the editor font size by 1px.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#destroyActivePane-instance'>
        ::<strong>destroyActivePane</strong>()
      </a>
    </span>
    <span class='desc'>
      Destroy (close) the active pane.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#destroyActivePaneItem-instance'>
        ::<strong>destroyActivePaneItem</strong>()
      </a>
    </span>
    <span class='desc'>
      Destroy (close) the active pane item.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#eachEditor-instance'>
        ::<strong>eachEditor</strong>(callback)
      </a>
    </span>
    <span class='desc'>
      Register a function to be called for every current and future <a href='Editor.html'>Editor</a> in the workspace.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#getActiveEditor-instance'>
        Editor ::<strong>getActiveEditor</strong>()
      </a>
    </span>
    <span class='desc'>
      Get the active item if it is an <a href='Editor.html'>Editor</a>.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#getActivePane-instance'>
        Pane ::<strong>getActivePane</strong>()
      </a>
    </span>
    <span class='desc'>
      Get the active <a href='Pane.html'>Pane</a>.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#getEditors-instance'>
        Array ::<strong>getEditors</strong>()
      </a>
    </span>
    <span class='desc'>
      Get all current editors in the workspace.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#getPanes-instance'>
        Array ::<strong>getPanes</strong>()
      </a>
    </span>
    <span class='desc'>
      Get all <a href='Pane.html'>Pane</a>s.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#increaseFontSize-instance'>
        ::<strong>increaseFontSize</strong>()
      </a>
    </span>
    <span class='desc'>
      Increase the editor font size by 1px.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#open-instance'>
        Editor ::<strong>open</strong>(uri, options = {})
      </a>
    </span>
    <span class='desc'>
      Open a given a URI in Atom asynchronously.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#openLicense-instance'>
        ::<strong>openLicense</strong>()
      </a>
    </span>
    <span class='desc'>
      Open Atom&#39;s license in the active pane.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#paneForUri-instance'>
        Pane ::<strong>paneForUri</strong>(uri)
      </a>
    </span>
    <span class='desc'>
      Get the first pane <a href='Pane.html'>Pane</a> with an item for the given URI.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#registerOpener-instance'>
        ::<strong>registerOpener</strong>(opener)
      </a>
    </span>
    <span class='desc'>
      Register an opener for a uri.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#reopenItemSync-instance'>
        ::<strong>reopenItemSync</strong>()
      </a>
    </span>
    <span class='desc'>
      Reopen the last-closed item&#39;s URI if it hasn&#39;t already been reopened.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#resetFontSize-instance'>
        ::<strong>resetFontSize</strong>()
      </a>
    </span>
    <span class='desc'>
      Restore to a default editor font size.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#saveActivePaneItem-instance'>
        ::<strong>saveActivePaneItem</strong>()
      </a>
    </span>
    <span class='desc'>
      Save the active pane item.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#saveActivePaneItemAs-instance'>
        ::<strong>saveActivePaneItemAs</strong>()
      </a>
    </span>
    <span class='desc'>
      Prompt the user for a path and save the active pane item to it.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#saveAll-instance'>
        ::<strong>saveAll</strong>()
      </a>
    </span>
    <span class='desc'>
      Save all pane items.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Workspace.html#unregisterOpener-instance'>
        ::<strong>unregisterOpener</strong>(opener)
      </a>
    </span>
    <span class='desc'>
      Unregister an opener registered with <a href='Workspace.html#registerOpener-instance'>::registerOpener</a>.
    </span>
  </li>
</ul>
      <h2>Instance Method Details</h2>
      <div class='methods'>
  <div class='method_details'>
    <p class='signature' id='activateNextPane-instance'>
      ::<strong>activateNextPane</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Make the next pane active.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='activatePreviousPane-instance'>
      ::<strong>activatePreviousPane</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Make the previous pane active.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='decreaseFontSize-instance'>
      ::<strong>decreaseFontSize</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Decrease the editor font size by 1px.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='destroyActivePane-instance'>
      ::<strong>destroyActivePane</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Destroy (close) the active pane.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='destroyActivePaneItem-instance'>
      ::<strong>destroyActivePaneItem</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Destroy (close) the active pane item.</p><p>Removes the active pane item and calls the <code>.destroy</code> method on it if one is
defined. </p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='eachEditor-instance'>
      ::<strong>eachEditor</strong>(callback)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Register a function to be called for every current and future <a href='Editor.html'>Editor</a> in the workspace.</p>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='type'>(Function)</span>
      <span class='name'>callback</span>
      &mdash;
      <span class='desc'>A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function'>Function</a> with an <a href='Editor.html'>Editor</a> as its only argument.</span>
    </li>
  </ul>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      <span class='desc'>Returns a subscription object with an <code>.off</code> method that you can call to
unregister the callback.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getActiveEditor-instance'>
      Editor ::<strong>getActiveEditor</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Get the active item if it is an <a href='Editor.html'>Editor</a>.</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt><a href='Editor.html'>Editor</a></tt>)
      &mdash;
      <span class='desc'>Returns an <a href='Editor.html'>Editor</a> or <code>undefined</code> if the current active item is not an
<a href='Editor.html'>Editor</a>.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getActivePane-instance'>
      Pane ::<strong>getActivePane</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Get the active <a href='Pane.html'>Pane</a>.</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt><a href='Pane.html'>Pane</a></tt>)
      &mdash;
      <span class='desc'>Returns a <a href='Pane.html'>Pane</a>.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getEditors-instance'>
      Array ::<strong>getEditors</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Get all current editors in the workspace.</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt>Array</tt>)
      &mdash;
      <span class='desc'>Returns an <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array'>Array</a> of <a href='Editor.html'>Editor</a>s.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getPanes-instance'>
      Array ::<strong>getPanes</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Get all <a href='Pane.html'>Pane</a>s.</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt>Array</tt>)
      &mdash;
      <span class='desc'>Returns an <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array'>Array</a> of <a href='Pane.html'>Pane</a>s.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='increaseFontSize-instance'>
      ::<strong>increaseFontSize</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Increase the editor font size by 1px.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='open-instance'>
      Editor ::<strong>open</strong>(uri, options = {})
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Open a given a URI in Atom asynchronously.</p>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='type'>(String)</span>
      <span class='name'>uri</span>
      &mdash;
      <span class='desc'>A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'>String</a> containing a URI.</span>
    </li>
    <li>
      <span class='type'>(Object)</span>
      <span class='name'>options</span>
      &mdash;
      <span class='desc'>An optional options <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'>Object</a></span>
    </li>
    <ul class='options'>
      <li>
        <span class='type'>(Number)</span>
        <span class='name'>initialLine</span>
        &mdash;
        <span class='desc'>A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number'>Number</a> indicating which row to move the cursor to initially. Defaults to <code>0</code>.</span>
      </li>
      <li>
        <span class='name'>split</span>
        &mdash;
        <span class='desc'>Either &#39;left&#39; or &#39;right&#39;. If &#39;left&#39;, the item will be opened in leftmost pane of the current active pane&#39;s row. If &#39;right&#39;, the item will be opened in the rightmost pane of the current active pane&#39;s row.</span>
      </li>
      <li>
        <span class='type'>(Boolean)</span>
        <span class='name'>activatePane</span>
        &mdash;
        <span class='desc'>A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether to call <a href='Pane.html#activate-instance'>Pane::activate</a> on the containing pane. Defaults to <code>true</code>.</span>
      </li>
      <li>
        <span class='type'>(Boolean)</span>
        <span class='name'>searchAllPanes</span>
        &mdash;
        <span class='desc'>A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a>. If <code>true</code>, the workspace will attempt to activate an existing item for the given URI on any pane. If <code>false</code>, only the active pane will be searched for an existing item for the same URI. Defaults to <code>false</code>.</span>
      </li>
    </ul>
  </ul>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt><a href='Editor.html'>Editor</a></tt>)
      &mdash;
      <span class='desc'>Returns a promise that resolves to the <a href='Editor.html'>Editor</a> for the file URI.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='openLicense-instance'>
      ::<strong>openLicense</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Open Atom&#39;s license in the active pane.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='paneForUri-instance'>
      Pane ::<strong>paneForUri</strong>(uri)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Get the first pane <a href='Pane.html'>Pane</a> with an item for the given URI.</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt><a href='Pane.html'>Pane</a></tt>)
      &mdash;
      <span class='desc'>Returns a <a href='Pane.html'>Pane</a> or <code>undefined</code> if no pane exists for the given URI.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='registerOpener-instance'>
      ::<strong>registerOpener</strong>(opener)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Register an opener for a uri.</p><p>An <a href='Editor.html'>Editor</a> will be used if no openers return a value.</p><h2 id="example">Example</h2>
<pre><code class="lang-coffeescript">atom.project.registerOpener (uri) -&gt;
  if path.extname(uri) is &#39;.toml&#39;
    return new TomlEditor(uri)
</code></pre>

</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='type'>(Function)</span>
      <span class='name'>opener</span>
      &mdash;
      <span class='desc'>A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function'>Function</a> to be called when a path is being opened.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='reopenItemSync-instance'>
      ::<strong>reopenItemSync</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Reopen the last-closed item&#39;s URI if it hasn&#39;t already been reopened.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='resetFontSize-instance'>
      ::<strong>resetFontSize</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Restore to a default editor font size.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='saveActivePaneItem-instance'>
      ::<strong>saveActivePaneItem</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Save the active pane item.</p><p>If the active pane item currently has a URI according to the item&#39;s
<code>.getUri</code> method, calls <code>.save</code> on the item. Otherwise
<a href='Workspace.html#saveActivePaneItemAs-instance'>::saveActivePaneItemAs</a> # will be called instead. This method does nothing
if the active item does not implement a <code>.save</code> method. </p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='saveActivePaneItemAs-instance'>
      ::<strong>saveActivePaneItemAs</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Prompt the user for a path and save the active pane item to it.</p><p>Opens a native dialog where the user selects a path on disk, then calls
<code>.saveAs</code> on the item with the selected path. This method does nothing if
the active item does not implement a <code>.saveAs</code> method. </p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='saveAll-instance'>
      ::<strong>saveAll</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Save all pane items.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='unregisterOpener-instance'>
      ::<strong>unregisterOpener</strong>(opener)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Unregister an opener registered with <a href='Workspace.html#registerOpener-instance'>::registerOpener</a>.</p>
</div>
<div class='tags'>
</div>
  </div>
</div>
    </div>
    <div id='footer'>
  Generated on
  Thu Mar 06 2014 17:48:26 GMT-0800 (PST)
  by
  <a href='https://github.com/gjtorikian/biscotto' title='TomDoc-CoffeeScript API documentation generator'>Biscotto</a>
  v2.1.1
  (Node.js v0.10.21).
  &#10034;
  Press Ctrl-h to see the keyboard shortcuts
</div>
  </body>
</html>